<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <button v-show="index > 0" @click="index--">上一页</button>
      <img :src="imgUrls[index]" alt="" />
      <button v-show="index < imgUrls.length - 1"  @click="index++">下一页</button>
    </div>

    <script src="../js/vue.js"></script>
    <script>
      var app = new Vue({
        el: "#app",
        data: {
          index: 0,
          imgUrls: [
            "../image/1.png",
            "../image/2.png",
            "../image/3.png",
            "../image/4.png",
          ],
        },
      });
    </script>
  </body>
</html>
